function KampanjaNew(){
	var kam = document.getElementById("KampanjaAdminEdit");
	var kamform = document.getElementById("KampanjaAdminEditForm");
	kamform.reset();
	kam.style.display='block';
}
function afterKampanjaNew(response){
	var tmp = response.split("{!}",2);
	var code = parseInt(tmp[0]);
	var msg = tmp[1];
	alert(msg);
	if(!code){
		LoadRSDoc("kampanje.php","setContent");
	}
}
function KampanjaEdit(tr){
	var tbl = tr.parentNode;
	var trs = tbl.getElementsByTagName("tr");
	var ef = document.getElementById("KampanjaAdminEditForm");
	
	// start from 1 to skip header row
	for(var i=1; i<trs.length; i++){
		trs[i].className = "";
	}
	
	tr.className = "selected";
	ef.elements["edit_kampanja_id"].value	= tr.getAttribute("kampanjaid");
	ef.elements["edit_kampanja_name"].value	= tr.getAttribute("kampanjaname");
	ef.elements["edit_kampanja_start"].value= tr.getAttribute("kampanjastart");
	ef.elements["edit_kampanja_end"].value	= tr.getAttribute("kampanjaend");
	ef.parentNode.style.display="block";
}
function afterKampanjaDelete(response){
	var tmp = response.split("{!}",2);
	var code = parseInt(tmp[0]);
	var msg = tmp[1];
	
	alert(msg);
	if(!code){
		LoadRSDoc("kampanje.php","setContent");
	}
}